package com.wry.controller;

import com.wry.service.StockApiService;
import com.wry.util.ApiResult;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <h1>  <h1>
 *
 * @author 魏如元
 * @since 2022/10/14
 */
@RestController
@RequestMapping("stock")
public class StockController {

    @Resource
    private StockApiService stockApiService;

    @PostMapping("deduction/{buyNum}/{goodId}")
    public void deductionStock(@PathVariable(value = "buyNum") Integer buyNum, @PathVariable(value = "goodId") Integer goodId){
        stockApiService.deductionStock(buyNum, goodId);
    }
}
